package com.ssy.lingxi.workflow.api.model.vo.response;

import java.io.Serializable;
import java.util.*;

/**
 * 查询外部流程、复杂流程时返回的VO
 * @author 万宁
 * @version 2.0.0
 * @date 2021-04-26
 */
public class ExternalTaskVO implements Serializable {
    private static final long serialVersionUID = 3470346570457535818L;

    public ExternalTaskVO() {
        this.taskStep = 0;
        this.taskName = "";
        this.memberRoleName = "";
        this.properties = new HashMap<>();
        this.subTasks = new ArrayList<>();
    }

    /**
     * 外部流程步骤
     */
    private Integer taskStep;

    /**
     * 外部流程名称
     */
    private String taskName;

    /**
     * 会员角色名称
     */
    private String memberRoleName;

    /**
     * 任务属性
     */
    private Map<String, String> properties;

    /**
     * 关联的内部任务列表
     */
    private List<InternalTaskVO> subTasks;

    public Integer getTaskStep() {
        return taskStep;
    }

    public void setTaskStep(Integer taskStep) {
        this.taskStep = taskStep;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getMemberRoleName() {
        return memberRoleName;
    }

    public void setMemberRoleName(String memberRoleName) {
        this.memberRoleName = memberRoleName;
    }

    public Map<String, String> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, String> properties) {
        this.properties = properties;
    }

    public List<InternalTaskVO> getSubTasks() {
        return subTasks;
    }

    public void setSubTasks(List<InternalTaskVO> subTasks) {
        this.subTasks = subTasks;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ExternalTaskVO taskVO = (ExternalTaskVO) o;
        return taskStep.equals(taskVO.taskStep) &&
                Objects.equals(taskName, taskVO.taskName) &&
                Objects.equals(memberRoleName, taskVO.memberRoleName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(taskStep, taskName, memberRoleName);
    }
}
